

import type { DelAllIds, UpdateStateIds, UserAddParams, UserInfoParams, UserInfoTypeObject, UserListObject, buildingTypeObject, housesObject } from "../type/userinfo";
import http from "../utils/request";

// 获取列表
export const userinfoList=(data:UserInfoParams)=>http.get<UserListObject>('/userinfo/list',data)
// 单个删除
export const userinfoDel=(id:number)=>http.get(`/userinfo/delete?id=${id}`)

// 添加
export const userinfoAdd=(data:UserAddParams) =>http.post('/userinfo/add',data)

// 批量删除
export const userinfoDelAll=(ids:DelAllIds)=>http.post(`/userinfo/deleteall`,ids)

// 获取居民类型列表
export const userinfotypeList=()=>http.get<UserInfoTypeObject>('/userinfotype/list')

// 获取楼栋一层列表
export const buildingList=()=>http.get<buildingTypeObject>('/building/list')


// 获取楼栋二层列表/houses/list
export const housesList=()=>http.get<housesObject>('/houses/list')

// 获取房间列表
export const buildingHouseId=(id:number)=>http.get<housesObject>(`/houses/list?buildingid=${id}`)

// 批量审核
export const userinfoUpdateState=(ids:UpdateStateIds) =>http.post('/userinfo/updatestate',ids)
